package com.hzhr.iot.toll.controller;

import com.hzhr.iot.core.annotation.ApiImplicitInternalParams;
import com.hzhr.iot.core.annotation.Author;
import com.hzhr.iot.core.annotation.CygQuery;
import com.hzhr.iot.core.annotation.CygQuerys;
import com.hzhr.iot.core.dto.ResponseExceptionDto;
import com.hzhr.iot.core.exception.ServiceException;
import com.hzhr.iot.toll.controller.base.BaseController;
import com.hzhr.iot.toll.model.gasUser.GasUserDeleteModel;
import com.hzhr.iot.toll.model.gasUser.GasUserGetModel;
import com.hzhr.iot.toll.model.gasUser.GasUserPostModel;
import com.hzhr.iot.toll.model.gasUser.GasUserPutModel;
import com.hzhr.iot.toll.service.GasUserService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

import java.util.Date;
import java.util.Map;

@Api(tags = "GasUser", description = "燃气用户")
@RestController
@RequestMapping(value = "")
public class GasUserController extends BaseController {
    @Autowired
    GasUserService gasUserService;

    //region /gas-users POST
    //region swagger响应码 : post
    @ApiResponses({
            @ApiResponse(code = 200, message = "成功"),
            @ApiResponse(code = 403, message = "----异常代码 : 201  \n----异常类型 : 业务流程异常  \n----异常业务 : 燃气用户代码认证  \n----异常说明 : 用户代码已存在  \n\n", response = ResponseExceptionDto.class),
    })
    //endregion
    //region swagger说明 : post
    @ApiOperation(value="在登录用户的管辖范围内创建燃气用户", notes="在登录用户的管辖范围内创建燃气用户  \n简介 : 在登录用户的管辖范围内创建燃气用户  \n步骤 :  \n1. 验证燃气用户代码 : (√)  \n如果body.code == null，建立以下循环来获取code：  \n          (1) 生成10位随机数str，验证str是否合法，验证规则如下：  \n                    根据str查询燃气用户(GAS_USER)对象gasUser，如果gasUser存在，则str不合法，查询筛选规则如下：  \n                              (1) gasUser.code = str；  \n                              (2) gasUser.companyId = 登录用户.companyId；  \n          (2) 如果str不合法，继续步骤(1)，直到str_1合法为止，code = str；  \n如果body.code != null，验证body.code是否合法，验证规则如下：  \n          查询燃气用户(GAS_USER)对象gasUser，如果gasUser存在，则body.code不合法，查询筛选规则如下：  \n                    (1) gasUser.code = str；  \n                    (2) gasUser.companyId = 登录用户.companyId；  \n 如果body.code不合法，则抛出异常201;  \n2. 创建燃气用户 : (√)  \n根据body创建燃气用户(GAS_USER)对象gasUser_1，  \n额外属性设置如下：  \n          (1) gasUser_1.resourceCode = 登录用户.userCode;  \n          (2) gasUser_1.deptId = 登录用户.deptId;  \n          (3) gasUser_1.companyId = 登录用户.companyId;  \n3. 返回模型 : (√)  \n根据请求条件参数返回创建好的燃气用户的数据模型;  \n",produces = "application/json")
    //endregion
    //region swagger参数 : post
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "show", value = "展示形式 one:展示一个,list:展示列表,null(空值):不展示", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "show_info", value = "是否展示详情", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),

            @ApiImplicitParam(name = "_show", value = "展示形式 one:展示一个,list:展示列表,null(空值):不展示", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_show_info", value = "是否展示详情", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
    })
    //endregion
    //region 请求 : post
    @RequestMapping(value = "/gas-users", method = RequestMethod.POST)
    //endregion
    @Author
    public ResponseEntity<GasUserGetModel> post(@RequestParam @ApiIgnore Map<String, Object> query,
                                                @RequestBody GasUserPostModel body) throws ServiceException {
        GasUserGetModel responseBody = gasUserService.post(initHeader(), query, body);
        return new ResponseEntity<>(responseBody, HttpStatus.OK);
    }
    //endregion
    //region /gas-users/{gasUserId} DELETE
    //region swagger响应码 : deleteById
    @ApiResponses({
            @ApiResponse(code = 200, message = "成功"),
    })
    //endregion
    //region swagger说明 : deleteById
    @ApiOperation(value="根据燃气用户编号删除登录用户管辖范围下的燃气用户", notes="根据燃气用户编号删除登录用户管辖范围下的燃气用户  \n简介 : 根据燃气用户编号删除登录用户管辖范围下的燃气用户  \n步骤 :  \n1. 删除燃气用户 : (√)  \n 根据路径参数gasUserId删除燃气用户(GAS_USER)对象gasUser_1，  \n 路径参数筛选规则：  \n (1) gasUser_1.id = 路径参数gasUserId;  \n2. 返回模型 : (√)  \n 根据删除情况返回删除模型;  \n",produces = "application/json")
    //endregion
    //region swagger参数 : deleteById
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "gasUserId", value = "燃气用户编号",required = true, dataType = "int", paramType = "path"),
    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),
    })
    //endregion
    //region 请求 : deleteById
    @RequestMapping(value = "/gas-users/{gasUserId}", method = RequestMethod.DELETE)
    //endregion
    @Author
    public ResponseEntity<GasUserDeleteModel> deleteById(@PathVariable("gasUserId") Integer gasUserId,
                                                         @RequestParam @ApiIgnore Map<String, Object> query) throws ServiceException {
        GasUserDeleteModel responseBody = gasUserService.deleteById(initHeader(), gasUserId, query);
        return new ResponseEntity<>(responseBody, HttpStatus.OK);
    }
    //endregion
    //region /gas-users/{gasUserId} PUT
    //region swagger响应码 : putById
    @ApiResponses({
            @ApiResponse(code = 200, message = "成功"),
    })
    //endregion
    //region swagger说明 : putById
    @ApiOperation(value="根据燃气用户编号修改登录用户管辖范围下的燃气用户信息", notes="根据燃气用户编号修改登录用户管辖范围下的燃气用户信息  \n简介 : 根据燃气用户编号修改登录用户管辖范围下的燃气用户信息  \n步骤 :  \n1. 查询燃气用户 : (√)  \n 根据请求路径参数gasUserId查询燃气用户(GAS_USER)对象gasUser_1，  \n 路径参数筛选规则如下：  \n (1) gasUser_1.id = 路径参数gasUserId；  \n 额外筛选规则如下：  \n (1) gasUser_1.resourceCode like 登录用户.userCode + '%'  \n 如果gasUser_1不存在，抛出异常201；  \n2. 验证新的燃气用户代码 : (√)  \n 如果body.code != gasUser_1.code，查询燃气用户(GAS_USER)对象gasUser_2，查询规则如下：  \n (1) gasUser_2.code = body.code；  \n 如果gasUser_2存在，抛出异常202；  \n3. 更新燃气用户:  (√)  \n 根据body更新gasUser_1;  \n4. 返回信息 : (√)  \n 查询更新后的gasUser_1，并根据请求条件参数生成结果对象并返回;  \n",produces = "application/json")
    //endregion
    //region swagger参数 : putById
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "gasUserId", value = "燃气用户编号",required = true, dataType = "int", paramType = "path"),

            @ApiImplicitParam(name = "show", value = "展示形式 one:展示一个,list:展示列表,null(空值):不展示", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "show_info", value = "是否展示详情", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),

            @ApiImplicitParam(name = "_show", value = "展示形式 one:展示一个,list:展示列表,null(空值):不展示", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_show_info", value = "是否展示详情", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
    })
    //endregion
    //region 请求 : putById
    @RequestMapping(value = "/gas-users/{gasUserId}", method = RequestMethod.PUT)
    //endregion
    @Author
    public ResponseEntity<GasUserGetModel> putById(@PathVariable("gasUserId") Integer gasUserId,
                                                  @RequestParam @ApiIgnore Map<String, Object> query,
                                                  @RequestBody GasUserPutModel body) throws ServiceException {
        GasUserGetModel responseBody = gasUserService.putById(initHeader(), gasUserId, query, body);
        return new ResponseEntity<>(responseBody, HttpStatus.OK);
    }
    //endregion
    //region /gas-users GET
    //region swagger响应码 : get
    @ApiResponses({
            @ApiResponse(code = 200, message = "成功"),
    })
    //endregion
    //region swagger说明 : get
    @ApiOperation(value="查询登录用户管辖范围下的燃气用户", notes="查询登录用户管辖范围下的燃气用户  \n简介 : 查询登录用户管辖范围下的燃气用户  \n步骤 :  \n1. 查询燃气用户 : (√)  \n 根据请求条件参数查询燃气用户(GAS_USER)对象集合gasUserList_1及总数，  \n 额外筛选条件如下：  \n gasUserList_1[i].resourceCode = 登录用户.userCode + '%';  \n2. 返回信息 : (√)  \n 根据条件参数和gasUserList_1及总数生成结果对象result并返回，  \n 其中GasUserModel模型的deptName属性的设置方法如下：  \n GLOBAL方式调用user_dept_nameService.get服务获取到Dept_NameModel模型对象进行设置，GasUserModel模型和Dept_NameModel模型的对应关系如下：  \n (1) GasUserModel模型的deptId属性对应于user-service的Dept_NameModel的id属性(一对一)；  \n (2) GasUserModel模型的deptName属性对应于user-service的Dept_NameModel的name属性；  \n",produces = "application/json")
    //endregion
    //region swagger参数 : get
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "show", value = "展示形式 one:展示一个,list:展示列表,null(空值):不展示", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "show_total", value = "是否展示总数", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "show_info", value = "是否展示详情", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "show_dept", value = "是否展示部门信息", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "show_gasConsume", value = "是否展示用气总量", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "page", value = "页数", defaultValue = "1",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "count", value = "每页数量", defaultValue = "1",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "equal_id", value = "筛选条件 : where gasUser.id = #{equal_id}",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "equal_code", value = "筛选条件 : where gasUser.code = #{equal_code}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "equal_deptId", value = "筛选条件 : where gasUser.deptId = #{equal_deptId}",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "equal_companyId", value = "筛选条件 : where gasUser.companyId = #{equal_companyId}",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "greaterthanorequal_createTime", value = "筛选条件 : where gasUser.createTime >= #{greaterthanorequal_createTime}",required = false, dataType = "long", paramType = "query"),
            @ApiImplicitParam(name = "lessthan_createTime", value = "筛选条件 : where gasUser.createTime < #{lessthan_createTime}",required = false, dataType = "long", paramType = "query"),
            @ApiImplicitParam(name = "like_name", value = "筛选条件 : where gasUser.name like #{like_name}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "like_address", value = "筛选条件 : where gasUser.address like #{like_address}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "equal_typeCode", value = "筛选条件 : where gasUser.typeCode = #{equal_typeCode}",required = false, dataType = "string", paramType = "query"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),

            @ApiImplicitParam(name = "_show", value = "展示形式 one:展示一个,list:展示列表,null(空值):不展示", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_show_total", value = "是否展示总数", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "_show_info", value = "是否展示详情", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "_show_dept", value = "是否展示部门信息", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "_show_gasConsume", value = "是否展示用气总量", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "_page", value = "页数", defaultValue = "1",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "_count", value = "每页数量", defaultValue = "1",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "_equal_id", value = "筛选条件 : where gasUser.id = #{_equal_id}",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "_equal_code", value = "筛选条件 : where gasUser.code = #{_equal_code}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_equal_deptId", value = "筛选条件 : where gasUser.deptId = #{_equal_deptId}",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "_equal_companyId", value = "筛选条件 : where gasUser.companyId = #{_equal_companyId}",required = false, dataType = "int", paramType = "query"),
            @ApiImplicitParam(name = "_greaterthanorequal_createTime", value = "筛选条件 : where gasUser.createTime >= #{_greaterthanorequal_createTime}",required = false, dataType = "long", paramType = "query"),
            @ApiImplicitParam(name = "_lessthan_createTime", value = "筛选条件 : where gasUser.createTime < #{_lessthan_createTime}",required = false, dataType = "long", paramType = "query"),
            @ApiImplicitParam(name = "_like_name", value = "筛选条件 : where gasUser.name like #{_like_name}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_like_address", value = "筛选条件 : where gasUser.address like #{_like_address}",required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_equal_typeCode", value = "筛选条件 : where gasUser.typeCode = #{_equal_typeCode}",required = false, dataType = "string", paramType = "query"),

    })
    //endregion
    //region 请求 : get
    @RequestMapping(value = "/gas-users", method = RequestMethod.GET)
    //endregion
    @Author
    public ResponseEntity<GasUserGetModel> get(@RequestParam @ApiIgnore Map<String, Object> query) throws Exception {
        GasUserGetModel responseBody = gasUserService.get(initHeader(), query);
        return new ResponseEntity<>(responseBody, HttpStatus.OK);
    }
    //endregion
    //region /gas-users/{gasUserId} GET
    //region swagger响应码 : getById
    @ApiResponses({
            @ApiResponse(code = 200, message = "成功"),
    })
    //endregion
    //region swagger说明 : getById
    @ApiOperation(value="根据燃气用户编号查询燃气用户", notes="根据燃气用户编号查询燃气用户  \n简介 : 查根据燃气用户编号询燃气用户  \n步骤 :  \n1. 查询燃气用户 : (√)  \n 根据请求条件参数和路径参数gasUserId查询燃气用户(GAS_USER)对象gasUser_1，  \n 路径参数筛选规则如下：  \n gasUser_1.id = 路径参数gasUserId;  \n2. 返回信息 : (√)  \n 根据gasUser_1和条件参数生成结果对象result并返回，  \n 其中GasUserModel模型的deptName属性的设置方法如下：  \n GLOBAL方式调用user_dept_nameService.get服务获取到Dept_NameModel模型对象进行设置，GasUserModel模型和Dept_NameModel模型的对应关系如下：  \n (1) GasUserModel模型的deptId属性对应于user-service的Dept_NameModel的id属性(一对一)；  \n (2) GasUserModel模型的deptName属性对应于user-service的Dept_NameModel的name属性；  \n",produces = "application/json")
    //endregion
    //region swagger参数 : getById
    @ApiImplicitParams({
            @ApiImplicitParam(name = "token", value = "令牌",required = true, dataType = "string", paramType = "header"),

            @ApiImplicitParam(name = "show", value = "展示形式 one:展示一个,list:展示列表,null(空值):不展示", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "show_total", value = "是否展示总数", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "show_info", value = "是否展示详情", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "show_dept", value = "是否展示部门信息", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "show_gasConsume", value = "是否展示用气总量", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),

    })
    @ApiImplicitInternalParams({
            @ApiImplicitParam(name = "_token", value = "令牌",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-id", value = "用户编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-code", value = "用户代码",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-name", value = "用户名",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-company-id", value = "公司编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-dept-id", value = "部门编号",required = true, dataType = "int", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-user-type", value = "用户类型(关联: common_service.options.code, typeCode = 'USER_TYPE')",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-id", value = "交易流水号",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-transaction-type", value = "交易类型",required = true, dataType = "string", paramType = "header"),
            @ApiImplicitParam(name = "_hzhr-access-mode", value = "访问模式 0:一般 1:全局",defaultValue = "0", required = false, dataType = "int", paramType = "header"),

            @ApiImplicitParam(name = "_show", value = "展示形式 one:展示一个,list:展示列表,null(空值):不展示", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "_show_total", value = "是否展示总数", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "_show_info", value = "是否展示详情", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "_show_dept", value = "是否展示部门信息", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),
            @ApiImplicitParam(name = "_show_gasConsume", value = "是否展示用气总量", defaultValue = "false", required = false, dataType = "boolean", paramType = "query"),

    })
    //endregion
    //region 请求 : getById
    @RequestMapping(value = "/gas-users/{gasUserId}", method = RequestMethod.GET)
    //endregion
    @Author
    public ResponseEntity<GasUserGetModel> getById(@PathVariable("gasUserId") Integer gasUserId,
                                                       @RequestParam @ApiIgnore Map<String, Object> query) throws Exception {
        GasUserGetModel responseBody = gasUserService.getById(initHeader(), gasUserId, query);
        return new ResponseEntity<>(responseBody, HttpStatus.OK);
    }
    //endregion
}















































































































































































































































































